function showOptionSelected(selectElement){
	if(selectElement.selectedIndex!=0){
		var value=selectElement.options[selectElement.selectedIndex].text;
		var spanElement=document.getElementById(selectElement.id+"Span");
		spanElement.innerHTML=value;
	}
	
	if(selectElement.id=="versionSubModelVehicle"){
		showDivButton();
	}
	
}

function fillHiddenOptionSelected(selectElement){
	if(selectElement.selectedIndex!=0){
		var value=selectElement.options[selectElement.selectedIndex].text;
		var hiddenElement=document.getElementById(selectElement.id+"Hidden");
		hiddenElement.value=value;
	}
	
	if(selectElement.id=="versionSubModelVehicle"){
		showDivButton();
	}
	
}

function showOptionSelectedClean(selectElement){
		var spanElement=document.getElementById(selectElement+"Span");
		spanElement.innerHTML="";
		hideDivButton();
}

function showDivButton(){
	var button=document.getElementById("divButtonNext");
	button.style.visibility="visible";
}

function hideDivButton(){
	var button=document.getElementById("divButtonNext");
	button.style.visibility="hidden";
}

function addNewFileInputLine(elementContainer,addPictureButton){
	var divElementContainer=document.getElementById(elementContainer);
	if (divElementContainer.childNodes.length<8){
	
		if (divElementContainer.childNodes.length==7){
			var addPictureButton=document.getElementById('addPictureButton');
			addPictureButton.style.visibility="hidden";
		}
		
		var div=document.createElement("div");
		
		var divWwgrp=document.createElement("div");
		divWwgrp.setAttribute("class", "wwgrp");
		divWwgrp.setAttribute("id", "wwgrp_addVehicleDetails_upload");
		
		var spanWwlbl=document.createElement("span");
		spanWwlbl.setAttribute("class", "wwlbl");
		spanWwlbl.setAttribute("id", "wwlbl_addVehicleDetails_upload");
		
		var labelPicture=document.createElement("label");
		labelPicture.setAttribute("class", "label");
		labelPicture.setAttribute("for", "addVehicleDetails_upload");
		labelPicture.setAttribute("class", "label");
		var labelText=document.createTextNode("Fotograf\u00EDa: ");
		labelPicture.appendChild(labelText);
		
		spanWwlbl.appendChild(labelPicture);
		
		var spanWwctrl=document.createElement("span");
		spanWwlbl.setAttribute("class", "wwctrl");
		spanWwlbl.setAttribute("id", "wwctrl_addVehicleDetails_upload");
		
		var input=document.createElement("input");
		input.setAttribute("type", "file");
		input.setAttribute("id", "addVehicleDetails_upload");
		input.setAttribute("value", "[]");
		input.setAttribute("name", "upload");
		spanWwctrl.appendChild(input);
		divWwgrp.appendChild(spanWwlbl);
		divWwgrp.appendChild(spanWwctrl);
		div.appendChild(divWwgrp);
		
		divElementContainer.appendChild(div);
		
	}else{
		alert("Estimado usuario, solo puede cargar 5 imagenes en este momento.");
	}
	
	
}